home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1997 / text0000.txt < prev   
Encoding:
Text File  |  1996-08-05  |  2.1 KB  |  58 lines

  1. In a message of 23 Jan 96 John Hendrikx wrote to All:
  2.  
  3.  JH> I don't think 'scanning' the database should become common among
  4.  JH> applications, so a good solution should be offered.  At the moment the
  5.  JH> display database does not tell you whether a screen is Chunky or Planar,
  6.  JH> or whether its layout is BGR or RGB and so on... we need more info from
  7.  JH> the data-base and a better way to get that info.
  8.  
  9.  Yep. Basically there needs to be a standard way of specifying display
  10. properties.. There was an interesting post on comp.graphics,algorithms on this
  11. topic..
  12.  
  13. *** Area: comp.graphics.algorithms                Date: 24 Jan 96 21:19:28 ***
  14. From: Vinnie Falco (2:999/99.0)
  15.  
  16. IMHO this group would greatly benefit from all answers concerning pixel images
  17. to be phrased in the form of C code, where images are represented with 8 bits
  18. per color component, 0=black, 255=white.
  19.  
  20. RGB = 8 bits per Red, Green, and Blue component (total 24 bits) CMYK = 8 bits
  21. per Cyan, Magenta, Yellow, Black compoenents (total 32 bits) Lab = 8 bits per
  22. L, a, b, with L=255 meaning 100 in the usual sense,
  23.   and with a and b being unsigned characters, 0..255 maps to the range
  24.   -127..127 with 128 representing a or b of zero. Grayscale = 8 bits for Black
  25. (total 8 bits).
  26.  
  27. Most images in memory can be laid out in any format (interleaved, planar,
  28. etc...) 
  29. using the following variables :
  30.  
  31. baseAddr = pointer to the first plane of the first row of the first column
  32. rowBytes = number of bytes per row of pixels colBytes = number of bytes per
  33. column of pixels planeBytes = number of bytes between one plane of color data
  34. and the next.
  35.  
  36. For example, an RGB interleaved image can be represented like this : rowBytes =
  37. columns * 3
  38. colBytes = 3
  39. planeBytes = 1
  40.  
  41. An RGB image stored planar (all the reds, then greens, then blues) can be 
  42. represented like this :
  43. rowBytes = columns
  44. colBytes = 1
  45. planeBytes = rows * columns
  46.  
  47. Even a Windows specific RGB bitmap (which is stored BGR) can be represented
  48. like 
  49. this :
  50. baseAddr = <pointer to beginning of data> + 2 rowBytes = columns * 3
  51. colBytes = 3
  52. planeBytes = -1
  53.  
  54. This in-memory format can represent the vast majority of image formats.
  55.  
  56. Ben... :)
  57.  
  58.